//
//  QuanzimanageViewCell.m
//  YiqiMobile
//
//  Created by henry on 13-4-17.
//  Copyright (c) 2013年 henry. All rights reserved.
//
#define BUTTONTAG 666
#import "MembermanageViewCell.h"
#import "Config.h"
#import "Utility.h"
#import "QuartzCore/QuartzCore.h"

@implementation MembermanageViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.logo=[[UIImageView alloc] initWithFrame:CGRectMake(10, 11, 40, 40)];
        NSString *logostr=@"";
        if (logostr&&logostr.length>0) {
            self.logo.image=[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",[Utility getServerUrl],logostr]]]];
        }else{
            self.logo.image=[Utility imageNamed:@"cg_logo.png"];
        }
        [self.logo.layer setMasksToBounds:YES];
        [self.logo.layer setCornerRadius:20.0f];
        [self addSubview:self.logo];
        
        
        self.labelContent=[Utility detailTextLabel:CGRectMake(60, 16, 190, 20) andFontSize:15.0];
        self.labelContent.textColor=[UIColor blackColor];
        [self addSubview:self.labelContent];
        
        self.labelDetail=[Utility detailTextLabel:CGRectMake(60, 40, 190, 20) andFontSize:15.0];
        self.labelDetail.textColor=[UIColor blackColor];
        [self addSubview:self.labelDetail];
        
        
        self.button1=[Utility customButton:self action:@selector(ButtonOfCellAction:) normalImage:@"cy_reject_normal.png" lightedImage:@"cy_reject_hover.png" frame:CGRectMake(205, 16, 49, 20) title:nil tag:BUTTONTAG];
        [self addSubview:self.button1];
        
        self.button2=[Utility customButton:self action:@selector(ButtonOfCellAction:) normalImage:@"cy_agree_normal.png" lightedImage:@"cy_agree_hover.png" frame:CGRectMake(260, 16, 49, 20) title:nil tag:BUTTONTAG+1];
        [self addSubview:self.button2];
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

-(void) ButtonOfCellAction:(UIButton*) sender{
    if (self.delegate&&[_delegate respondsToSelector:@selector(buttonOfCellAction:andtag:)]) {
        [_delegate buttonOfCellAction:self.indexPath andtag:sender.tag-BUTTONTAG] ;
    }
    
}

@end
